import { allPermissionsList, leftMenuPermissions } from '@/api/table'
const state = {
  tableList: []
}

const mutations = {
  getTableList(state, payload) {
    state.tableList = payload
    // console.log(state.tableList)
  }
}

const actions = {
  // 左侧菜单权限
  async getTableList(context, payload) {
    const res = await leftMenuPermissions()
    // console.log(res)
    context.commit('getTableList', res)
  },
  // 所有权限列表
  async allPermissionList(context, payload) {
    await allPermissionsList(payload)
    // console.log(res)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

